Ext.define('AM.view.window.AddTree', {
    extend: 'Ext.window.Window',
    alias : 'widget.addtree',
    stores: ['StoreComboPro','StoreComboSubpro','StoreComboCild'],
    title : 'Add New',
    layout: 'fit',
    autoShow: true,
    modal : true,
        
    initComponent: function() {
        this.items = [
            {
                xtype: 'form',
                bodyPadding: '5px,5px,5px,5px',
                layout: 'anchor',
                width: 400,
                defaults: {
                    anchor: '100%'
                },
                items: [{
                    	xtype:'pro',
                    	id:'pro',
                    },{
                    	xtype:'subpro',
                    	id:'subpro'
                    },{
                    	xtype:'cild',
                    	id:'cild'
                    },{
                    	xtype:'tip',
                    	hidden : true,
                    	id:'tip',
                    	
                    }
                ]
            }
        ];

        this.buttons = [
            {
                text: 'Save',
                id:'savee',
                action: 'savee',
                iconCls: "btn-save",
                //icon:'images/add.png',
                //handler:this.addTree,
            	//scope: this
            },{
                text: 'Cancel',
                scope: this,
                handler: this.close
            }
        ];

        this.callParent(arguments);
    },
    /*addTree: function (obj,e) {
    	console.log('Add new Tree insert...');
    	var win = obj.up('window');
    	subpro = win.down('subpro').getValue();
    	pro = win.down('pro').getValue();
    	cild = win.down('cild').getValue();
        //form = win.down('form'),
        //values = form.getValues();
    	//console.log(pro);
   	 	//console.log(subpro);
   	 	//console.log(cild);
    	console.log(selecttree);
    	//view.down('form').getForm().loadRecord(vnode);
    	if(selecttree[0].data.iconCls=='task'){
    		console.log('task');
    	}
    	else if(selecttree[0].data.iconCls=='task-folder'){
    		console.log('task-folder');
    	}
    	else if(selecttree[0].data.iconCls=='task-folder-root'){
    		console.log('task-folder-root');
    	}		    
	},*/
    
});